package com.bawan.vims.servlet;

import java.util.Date;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * <p> Title        : VimsServletListener.java </p>
 * <p> Description	: VimsServletListener.java </p>
 * <p> Copyright	: Copyright (c) 2015 by FITT</p>
 * <p> Author 		: JOCHEN ZHENG </p>
 * <p> Create		: 2015-1-5 11:31:52 </p> 
 * <p> version 		: 1.0 </p>
 */
@WebListener
public class VimsServletListener implements ServletContextListener {
	private static Logger logger = LoggerFactory.getLogger(VimsServletListener.class);

	@SuppressWarnings("deprecation")
	@Override
	public void contextDestroyed(ServletContextEvent event) {
		System.out.println(new Date().toLocaleString() + ", VimsServletListener had Destoryed!");
		logger.info(new Date().toLocaleString() + ", VimsServletListener had Destoryed!");
	}

	@SuppressWarnings("deprecation")
	@Override
	public void contextInitialized(ServletContextEvent event) {
		System.out.println(new Date().toLocaleString() + ", VimsServletListener had Initialized!");
		logger.info(new Date().toLocaleString() + ", VimsServletListener had Initialized!");
	}

}
